The present invention relates to the field of networking devices, and more particularly to a programmable arbitration system for determining the priority of the ports of a network switch.
There are many different types of networks and network systems for sharing files and resources or for otherwise enabling communication between two or more computers. Networks may be categorized based on various features and functions, such as message capacity, range over which the nodes are distributed, node or computer types, node relationships, topology or logical and/or physical layout, architecture or structure based on cable type and data packet format, access possibilities, etc. For example, the range of a network refers to the distance over which the nodes are distributed, such as local-area networks (LANs) within an office or floor of a building, wide-area networks (WANs) spanning across a college campus, or a city or a state, global-area networks (GANs) spanning across national boundaries, etc.
The structure of a network generally refers to the cabling or media and media access used as well as the packet structure of the data transmitted across the media. Various structures are common, including Ethernet using coaxial, twisted pair or fiber-optic cables for operation at 10 megabits per second (Mbps) (e.g. 10Base-T, 10Base-F) or fast Ethernet operating at 100 Mbps (e.g. 100Base-T, 100Base-FX). ARCnet (Attached Resource Computer Network) is a relatively inexpensive network structures using coaxial, twisted pair or fiber-optic cables for operation at 2.5 Mbps. Token Ring topologies use special IBM cable or fiber-optic cable for operation between 1-16 Mbps. Of course, many other types of networks are known and available.
Each network generally includes two or more computers, often referred to as nodes or stations, which are coupled together through selected media and various other network devices for relaying, transmitting, repeating, translating, filtering, etc., the data between the nodes. The term xe2x80x9cnetwork devicexe2x80x9d generally refers to the computers and their network interface cards (NICs) as well as various other devices on the network, such as repeaters, bridges, switches, routers, brouters, to name a few examples. A network operating according to a given communications protocol may be expanded by using one or more repeaters, bridges or switches. A repeater is a hardware device that functions at the physical layer and re-transmits each received packet to every other port. A bridge operates at the data link layer of OSI Reference Model and increases efficiency by filtering packets to reduce the amount of unnecessary packet propagation on each network segment.
A network switch is similar in function to, yet more efficient than, a multiport bridge, which includes a plurality of ports for coupling to several similar networks for directing network traffic among the networks. A network switch may include a switching matrix or the like coupled to the ports across a bus for controlling data flow between the ports. The switching matrix must somehow determine when a port has received data from a network device and when a port is available to receive data for transmission. The switching matrix must further determine priority among the ports to determine when to service each port.
It is desired to provide an efficient system for determining priority for selecting and for servicing multiple ports of a network switch.
A programmable arbitration system according to the present invention includes control logic to select one of several arbitration schemes for selecting the ports of a network switch, a memory to store priority values indicating the relative priority of each of the ports, monitor logic to monitor each of the ports and to program the priority values in the memory based on a priority scheme selected by the control logic, and arbitration logic to select a port having the next highest priority. The control logic is preferably a processor that executes a driver routine that controls the network switch. More particularly, the user of the network switch selects an arbitration scheme by interfacing a program or control routine executed by the processor for controlling the network switch. The control logic indicates the appropriate arbitration scheme to use.
The arbitration schemes preferably include a round-robin priority scheme, a first-come, first-served (FCFS) priority scheme and a weighted priority scheme. For each scheme, only those ports requesting service are considered, otherwise called xe2x80x9cactivexe2x80x9d ports, including the ports receiving a packet or the ports having available buffer space to transmit a packet. In the round-robin scheme, the ports are prioritized according to a predetermined order, and the active ports are serviced according to the predetermined order. In the FCFS priority scheme, the active ports are prioritized according to when each port first requested service. In the weighted priority scheme, a user-defined port priority weight list including per port weight factors determines the relative priority of each port. Accordingly, the active port having the highest priority weight factor is serviced first for the weighted priority scheme.
Each port includes a receive priority count and a transmit priority count, which are assigned according to the selected arbitration scheme. For round-robin and weighted priority, the receive and transmit priority counts are loaded from the weight factors. For FCFS, the receive and transmit priority counts are loaded by the monitor logic with continuously updated receive and transmit count numbers, respectively, at the time the port requested service. Status values in the memory include a transmit active value and a receive active value indicating whether a corresponding port requested transmit or receive service, respectively, where the monitor logic updates the active value for a port when that port requested service. The memory further stores receive and transmit count values which are used and updated by the arbitration logic. For round-robin and FCFS, the arbitration logic selects an active port for service based on a comparison of the receive or transmit count values compared to the receive and transmit priority counts, respectively. For weighted priority, the count values are not used, but the arbitration logic selects the active port with the highest receive or transmit priority count. Of course, any combination or all of the arbitration schemes discussed may be included in particular implementations.
In one embodiment, the monitor logic includes polling logic to periodically poll the ports, to update the count value, to program a priority value of a corresponding port by combining the current value of the count value when the port requested service with the number of other higher priority ports that requested service when polled. A predetermined priority order ensures unique priority assignment in the event of simultaneous responses between the ports. The number of higher priority ports may be determined in any desired manner, such as determining a bitsum of the number of status signals asserted by the higher priority ports. The polling logic then increments the count value by the total number of ports that indicated needing service when polled.
Each port includes port status logic that receives a query signal and responds with a receive status signal indicative of whether that port has received data from a network device and a transmit status signal indicative of whether that port has available space to receive data to transmit to a network device. The monitor logic includes polling logic to periodically assert a query signal and to receive a transmit status signal and a receive status signal from each of the ports, where the polling logic receives a plurality of transmit status signals and a plurality of receive status signals corresponding to the plurality of ports. The memory includes a receive list to indicate which of the ports have indicated received data and a transmit list to indicate of which of the ports have indicated having space to receive data to transmit. The polling logic includes a receive state machine to monitor the receive status signals and to periodically update the receive list, and a transmit state machine to monitor the transmit status signals and to periodically update the transmit list.
Preferably, the receive list includes a receive active bit for each of the ports, where the receive state machine sets a corresponding receive active bit when a corresponding port indicates having received data from a network device. Each receive active bit is cleared when data is read from the corresponding port. Further, the transmit list includes a transmit active bit for each of the ports, where the transmit state machine sets a corresponding transmit active bit when a port indicates having space to receive data to transmit to a network device. Each transmit active bit being cleared when the corresponding port is provided with data to transmit. Also, the receive list includes a receive priority count for each of the ports. For the FCFS case, the receive state machine updates a corresponding receive priority count when a corresponding port indicates having received data from a network device, and the transmit list includes a transmit priority count for each of the ports, where the transmit state machine updates a corresponding transmit priority count when a corresponding port indicates having space to receive data to transmit to a network device.
The receive state machine updates a receive count value, determines the receive priority value of a corresponding port based on the receive count value and on the number of other higher priority ports that indicate having received data when polled, and increments the count value by the total number of ports that indicate having received data when polled. Also, the transmit state machine updates a transmit count value, determines the transmit priority value of a corresponding port based on the transmit count value and on the number of other higher priority ports that indicate having space for receiving data when polled. The count value is then incremented by the total number of ports that indicate having space for receiving data when polled.
The arbitration logic includes at least one receive arbiter which uses a receive arbitration count, where the receive arbiter increments the receive arbitration count and selects a port based on the receive active bits and the receive arbitration count compared to the receive priority counts of each of the ports. The arbitration logic further includes at least one transmit arbiter which uses a transmit arbitration count, where the transmit arbiter increments the transmit arbitration count and selects a port based on the transmit active bits and on the transmit arbitration count compared to the transmit priority counts of each of the ports.
A programmable arbitration scheme according to the present invention is useful for a network switch for relaying data packets between a plurality of network devices. The network switch includes a plurality of network ports to receive and to transmit data packets, and a switch manager including the control logic, the memory, the monitor logic and the arbitration logic. A network switch according to the present invention is useful for a network system including a plurality of network devices for transferring data packets between the network devices.
It is now appreciated that a programmable arbitration priority system according to the present invention provides an efficient system for determining priority to select and to service multiple ports of a network switch.